# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=python-ly
pkgver=0.9.7
pkgrel=4
pkgdesc="Parse, manipulate or create documents in LilyPond format"
arch=('any')
url="https://github.com/frescobaldi/python-ly"
license=('GPL')
depends=('python')
makedepends=('python-setuptools' 'python-sphinx')
source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('2d4edd236ea1247a51cad409c8a5895ed261fe7d309b48f451c5c16db342497086381d7cb38f6e35f77d6f3e37a375e304d5d653e0ed7df071df4e372b84a05f')
b2sums=('200a482b0f50667fe9cca0ef47dbce96473cf74597b3f4572f9bffd452b476cb7fe0afb7ab9aabb31e43ef62c10646ffc558ea4fa3478a81784e4aab0df48764')

build() {
  cd "$pkgname-$pkgver"
  python setup.py build
  cd doc
  make man text
}

package() {
  cd "$pkgname-$pkgver"
  python setup.py install --skip-build \
    --optimize=1 \
    --root="${pkgdir}"
  # docs
  install -vDm 644 {ChangeLog,README.rst} \
    -t "${pkgdir}/usr/share/doc/${pkgname}/"
  # text readme
  install -vDm 644 doc/build/text/* \
    -t "${pkgdir}/usr/share/doc/${pkgname}/text/"
  # man pages
  install -vDm 644 doc/build/man/* \
    -t "${pkgdir}/usr/share/man/man1/"
}
